import React, { Component } from 'react'
import Login from './Login'

export default class Common extends Component {
  state = {
    username: '',
    password: '',
    repassword: '',
  }
  handle = (name) => (e) => {
    this.setState({
      [name]: e.target.value.trim(),
    })
  }
  render() {
    return (
      <div>
        <this.props.ele
          username={this.state.username}
          password={this.state.password}
          repassword={this.state.repassword}
          handle={this.handle}
        ></this.props.ele>
      </div>
    )
  }
}
